
import {updateStudent} from '@/util/actions/studentAction'
import{fetchById}from '@/util/actions/studentAction'
import { Epilogue } from 'next/font/google'

export default async function SingleStudentPage({params}) {
    console.log("被查看的学生id"+params.id)
// const fromData=(date)=>{
//     const d =new Date(date);
//     const y
// }
    const {id}=params;
    const student =await fetchById(id);
    if(student){
        console.log("被查看的学生id"+student)
    }else{
        console.log("没有找到")
    }
    // const fromattedDate =formatDate()
    return(
        <div>
            <form action={updateStudent}>
            <input type="hidden" name="id" value={id} />
          <label>姓名</label>
          <input type="text" name="name" defaultValue={student.name}  required/>
          <br/>
          <button type="submit">提交</button>

          </form>

        </div>
    )


}

